package cn.saas.test;


import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.ToOne;
import org.greenrobot.greendao.annotation.Transient;
import org.greenrobot.greendao.annotation.Unique;

import java.io.Serializable;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.DaoException;
import cn.saas.test.greendao.gen.DaoSession;
import cn.saas.test.greendao.gen.TowerBeanDao;
import cn.saas.test.greendao.gen.HoleBeanDao;

/**
 * @Title :
 * @date : 2021/5/10 19:31
 */
@Entity(nameInDb = "hole_detail")
public class HoleBean implements Serializable {
    private static final long serialVersionUID = 1826401059254630671L;
    // 是否选中
    @Transient
    private boolean selected;

//    @Unique
    @Id(autoincrement = true)
    private Long id;

//    @Unique
    private Long holeId;

    // ("projectpk")
    private String projectpk;

    // 详细地址
    // ("address")
    private String address;

    // 实际深度
    // ("adepth")
    private Double adepth;


    // 成孔设备类型
    // ("deviceType")
    private String deviceType;

    //孔口高程(m)
    @Transient
    // ("altitude")
    private Double altitude;

    // 施工单位
    @Transient
    // ("construction")
    private String construction;

    // 设计深度
    // ("depth")
    private Double depth;

    // 钻孔直径(mm)
    @Transient
    // ("diameter")
    private Double diameter;

    // 偏移距离
    // ("distance")
    private Double distance;

    // 偏移原因
    // ("distanceReason")
    private String distanceReason;

    // 终孔日期
    @Transient
    // ("endTime")
    private String endTime;

    // 初始水位(m)
    @Transient
    // ("firstWater")
    private Double firstWater;

    // 初始水位时间
    @Transient
    // ("firstWaterTime")
    private String firstWaterTime;

    // 钻孔编号
    // ("holeCode")
    private String holeCode;

    // 勘探点类型
    // ("holeType")
    private String holeType;

    // 钻进工艺
    @Transient
    // ("holeCraft")
    private String holeCraft;

    // 机型 1：普通三脚架钻机、2：履带式钻机  3：水文钻机
    @Transient
    // ("machineType")
    private String machineType;

    // 机高
    @Transient
    // ("machineHeight")
    private Double machineHeight;

    // 主键  外键 对于 towerBean
    // ("holepk")
    private String holepk;

    @ToOne(joinProperty = "holeId")
    private TowerBean towerBean;

    //最后记录时间
    // ("lastTime")
    private String updateTime;

    //创建时间
    // ("createTime")
    private String createTime;

    // 机长签名
    @Transient
    // ("caption")
    private String caption;

    // 记录人姓名
    // ("username")
    private String username;

    // 纬度
    // ("latitude")
    private Double latitude;

    // 经度
    // ("longitude")
    private Double longitude;

    // 隶属企业
    @Transient
    // ("orgpk")
    private String orgpk;


    //备注
    // ("remark")
    private String remark;

    //稳定水位(m
    @Transient
    // ("stableWater")
    private Double stableWater;

    // 稳定水位时间
    @Transient
    // ("stableWaterTime")
    private String stableWaterTime;

    // 开孔日期
    @Transient
    // ("startTime")
    private String startTime;

    // 状态 0：未开始 1：已开始 2：终孔 9：异常
    // ("status")
    private Integer status;

    //塔位编号
    // ("towerCode")
    private String towerCode;

    // 钻孔位置（线路工程）
    // ("towerSite")
    private String towerSite;

    // 所属塔位（线路工程：塔位）
    // ("towerpk")
    private String towerpk;

    //井深(m)
    @Transient
    // ("wellDepth")
    private Double wellDepth;

    // X坐标
    @Transient
    // ("x")
    private Double x;

    // Y坐标
    @Transient
    // ("y")
    private Double y;

    // 1 待上传 2 已上传 3 已下载
    // ("syncStatus")
    private int syncStatus;


    // ("lastSyncTime")
    private String lastSyncTime;

    // 是否塔位钻孔
    // ("isTowerHole")
    private boolean isTowerHole;

    // ("towerPk")
    private String towerPk;

    // 记录人主键
    // ("perpk")
    private String perpk;

    //回次记录  此字段无用 回次记录表 数据在 hole_record
    @Transient
    private String recordpk;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 301069943)
    private transient HoleBeanDao myDao;

    @Override
    public String toString() {
        return "HoleBean{" +
                "selected=" + selected +
                ", id=" + id +
                ", holeId=" + holeId +
                ", projectpk='" + projectpk + '\'' +
                ", address='" + address + '\'' +
                ", adepth=" + adepth +
                ", deviceType='" + deviceType + '\'' +
                ", altitude=" + altitude +
                ", construction='" + construction + '\'' +
                ", depth=" + depth +
                ", diameter=" + diameter +
                ", distance=" + distance +
                ", distanceReason='" + distanceReason + '\'' +
                ", endTime='" + endTime + '\'' +
                ", firstWater=" + firstWater +
                ", firstWaterTime='" + firstWaterTime + '\'' +
                ", holeCode='" + holeCode + '\'' +
                ", holeType='" + holeType + '\'' +
                ", holeCraft='" + holeCraft + '\'' +
                ", machineType='" + machineType + '\'' +
                ", machineHeight=" + machineHeight +
                ", holepk='" + holepk + '\'' +
                ", towerBean=" + towerBean +
                ", updateTime='" + updateTime + '\'' +
                ", createTime='" + createTime + '\'' +
                ", caption='" + caption + '\'' +
                ", username='" + username + '\'' +
                ", latitude=" + latitude +
                ", longitude=" + longitude +
                ", orgpk='" + orgpk + '\'' +
                ", remark='" + remark + '\'' +
                ", stableWater=" + stableWater +
                ", stableWaterTime='" + stableWaterTime + '\'' +
                ", startTime='" + startTime + '\'' +
                ", status=" + status +
                ", towerCode='" + towerCode + '\'' +
                ", towerSite='" + towerSite + '\'' +
                ", towerpk='" + towerpk + '\'' +
                ", wellDepth=" + wellDepth +
                ", x=" + x +
                ", y=" + y +
                ", syncStatus=" + syncStatus +
                ", lastSyncTime='" + lastSyncTime + '\'' +
                ", isTowerHole=" + isTowerHole +
                ", towerPk='" + towerPk + '\'' +
                ", perpk='" + perpk + '\'' +
                ", recordpk='" + recordpk + '\'' +
                ", daoSession=" + daoSession +
                ", myDao=" + myDao +
                ", towerBean__resolvedKey=" + towerBean__resolvedKey +
                '}';
    }

    @Generated(hash = 298250400)
    public HoleBean(Long id, Long holeId, String projectpk, String address,
            Double adepth, String deviceType, Double depth, Double distance,
            String distanceReason, String holeCode, String holeType, String holepk,
            String updateTime, String createTime, String username, Double latitude,
            Double longitude, String remark, Integer status, String towerCode,
            String towerSite, String towerpk, int syncStatus, String lastSyncTime,
            boolean isTowerHole, String towerPk, String perpk) {
        this.id = id;
        this.holeId = holeId;
        this.projectpk = projectpk;
        this.address = address;
        this.adepth = adepth;
        this.deviceType = deviceType;
        this.depth = depth;
        this.distance = distance;
        this.distanceReason = distanceReason;
        this.holeCode = holeCode;
        this.holeType = holeType;
        this.holepk = holepk;
        this.updateTime = updateTime;
        this.createTime = createTime;
        this.username = username;
        this.latitude = latitude;
        this.longitude = longitude;
        this.remark = remark;
        this.status = status;
        this.towerCode = towerCode;
        this.towerSite = towerSite;
        this.towerpk = towerpk;
        this.syncStatus = syncStatus;
        this.lastSyncTime = lastSyncTime;
        this.isTowerHole = isTowerHole;
        this.towerPk = towerPk;
        this.perpk = perpk;
    }

    @Generated(hash = 423571781)
    public HoleBean() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getHoleId() {
        return this.holeId;
    }

    public void setHoleId(Long holeId) {
        this.holeId = holeId;
    }

    public String getProjectpk() {
        return this.projectpk;
    }

    public void setProjectpk(String projectpk) {
        this.projectpk = projectpk;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Double getAdepth() {
        return this.adepth;
    }

    public void setAdepth(Double adepth) {
        this.adepth = adepth;
    }

    public String getDeviceType() {
        return this.deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public Double getDepth() {
        return this.depth;
    }

    public void setDepth(Double depth) {
        this.depth = depth;
    }

    public Double getDistance() {
        return this.distance;
    }

    public void setDistance(Double distance) {
        this.distance = distance;
    }

    public String getDistanceReason() {
        return this.distanceReason;
    }

    public void setDistanceReason(String distanceReason) {
        this.distanceReason = distanceReason;
    }

    public String getHoleCode() {
        return this.holeCode;
    }

    public void setHoleCode(String holeCode) {
        this.holeCode = holeCode;
    }

    public String getHoleType() {
        return this.holeType;
    }

    public void setHoleType(String holeType) {
        this.holeType = holeType;
    }

    public String getHolepk() {
        return this.holepk;
    }

    public void setHolepk(String holepk) {
        this.holepk = holepk;
    }

    public String getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Double getLatitude() {
        return this.latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public Double getLongitude() {
        return this.longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getStatus() {
        return this.status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getTowerCode() {
        return this.towerCode;
    }

    public void setTowerCode(String towerCode) {
        this.towerCode = towerCode;
    }

    public String getTowerSite() {
        return this.towerSite;
    }

    public void setTowerSite(String towerSite) {
        this.towerSite = towerSite;
    }

    public String getTowerpk() {
        return this.towerpk;
    }

    public void setTowerpk(String towerpk) {
        this.towerpk = towerpk;
    }

    public int getSyncStatus() {
        return this.syncStatus;
    }

    public void setSyncStatus(int syncStatus) {
        this.syncStatus = syncStatus;
    }

    public String getLastSyncTime() {
        return this.lastSyncTime;
    }

    public void setLastSyncTime(String lastSyncTime) {
        this.lastSyncTime = lastSyncTime;
    }

    public boolean getIsTowerHole() {
        return this.isTowerHole;
    }

    public void setIsTowerHole(boolean isTowerHole) {
        this.isTowerHole = isTowerHole;
    }

    public String getTowerPk() {
        return this.towerPk;
    }

    public void setTowerPk(String towerPk) {
        this.towerPk = towerPk;
    }

    public String getPerpk() {
        return this.perpk;
    }

    public void setPerpk(String perpk) {
        this.perpk = perpk;
    }

    @Generated(hash = 1809557166)
    private transient Long towerBean__resolvedKey;

    /** To-one relationship, resolved on first access. */
    @Generated(hash = 945934018)
    public TowerBean getTowerBean() {
        Long __key = this.holeId;
        if (towerBean__resolvedKey == null
                || !towerBean__resolvedKey.equals(__key)) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            TowerBeanDao targetDao = daoSession.getTowerBeanDao();
            TowerBean towerBeanNew = targetDao.load(__key);
            synchronized (this) {
                towerBean = towerBeanNew;
                towerBean__resolvedKey = __key;
            }
        }
        return towerBean;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1250709168)
    public void setTowerBean(TowerBean towerBean) {
        synchronized (this) {
            this.towerBean = towerBean;
            holeId = towerBean == null ? null : towerBean.getId();
            towerBean__resolvedKey = holeId;
        }
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1665874185)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getHoleBeanDao() : null;
    }


}
